#define _CRT_SECURE_NO_WARNINGS	

/*
struct ListNode {
    int val;
    struct ListNode *next;
    ListNode(int x) : val(x), next(NULL) {}
};*/
int arr[910];
class PalindromeList {
public:
    bool chkPalindrome(ListNode* A)
    {
        // write code here
        int count = 0;
        ListNode* pcur = A;
        while (pcur)
        {
            arr[count] = pcur->val;
            count++;
            pcur = pcur->next;
        }
        int left = 0;
        int right = count - 1;
        while (left <= right)
        {
            if (arr[left] != arr[right])
                return false;
            left++;
            right--;
        }
        return true;
    }
};